3.111 \(\int \frac {\tan ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx\)

Optimal. Leaf size=98 \[ -\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}-\frac {i}{d \sqrt {a+i a \tan (c+d x)}}+\frac {i \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d} \]

[Out]

1/2*I*arctanh(1/2*(a+I*a*tan(d*x+c))^(1/2)*2^(1/2)/a^(1/2))/d*2^(1/2)/a^(1/2)-I/d/(a+I*a*tan(d*x+c))^(1/2)-2*I
*(a+I*a*tan(d*x+c))^(1/2)/a/d

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 98, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3543, 3479, 3480, 206} \[ -\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}-\frac {i}{d \sqrt {a+i a \tan (c+d x)}}+\frac {i \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^2/Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

(I*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/(Sqrt[2]*Sqrt[a])])/(Sqrt[2]*Sqrt[a]*d) - I/(d*Sqrt[a + I*a*Tan[c + d*x]
]) - ((2*I)*Sqrt[a + I*a*Tan[c + d*x]])/(a*d)

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3479

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(a*(a + b*Tan[c + d*x])^n)/(2*b*d*n), x] +
Dist[1/(2*a), Int[(a + b*Tan[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0]

Rule 3480

Int[Sqrt[(a_) + (b_.)*tan[(c_.) + (d_.)*(x_)]], x_Symbol] :> Dist[(-2*b)/d, Subst[Int[1/(2*a - x^2), x], x, Sq
rt[a + b*Tan[c + d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0]

Rule 3543

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[
(d^2*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Int[(a + b*Tan[e + f*x])^m*Simp[c^2 - d^2 + 2*c*d*Tan[e
 + f*x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] &&  !LeQ[m, -1] &&  !(EqQ[m, 2] && EqQ
[a, 0])

Rubi steps

\begin {align*} \int \frac {\tan ^2(c+d x)}{\sqrt {a+i a \tan (c+d x)}} \, dx &=-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}-\int \frac {1}{\sqrt {a+i a \tan (c+d x)}} \, dx\\ &=-\frac {i}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}-\frac {\int \sqrt {a+i a \tan (c+d x)} \, dx}{2 a}\\ &=-\frac {i}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}+\frac {i \operatorname {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d}\\ &=\frac {i \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{\sqrt {2} \sqrt {a} d}-\frac {i}{d \sqrt {a+i a \tan (c+d x)}}-\frac {2 i \sqrt {a+i a \tan (c+d x)}}{a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.79, size = 113, normalized size = 1.15 \[ -\frac {i \left (\sqrt {1+e^{2 i (c+d x)}} \left (1+5 e^{2 i (c+d x)}\right )-e^{i (c+d x)} \left (1+e^{2 i (c+d x)}\right ) \sinh ^{-1}\left (e^{i (c+d x)}\right )\right )}{d \left (1+e^{2 i (c+d x)}\right )^{3/2} \sqrt {a+i a \tan (c+d x)}} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^2/Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

((-I)*(Sqrt[1 + E^((2*I)*(c + d*x))]*(1 + 5*E^((2*I)*(c + d*x))) - E^(I*(c + d*x))*(1 + E^((2*I)*(c + d*x)))*A
rcSinh[E^(I*(c + d*x))]))/(d*(1 + E^((2*I)*(c + d*x)))^(3/2)*Sqrt[a + I*a*Tan[c + d*x]])

________________________________________________________________________________________

fricas [B]  time = 0.44, size = 237, normalized size = 2.42 \[ \frac {{\left (i \, \sqrt {2} a d \sqrt {\frac {1}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (4 \, {\left ({\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {1}{a d^{2}}} + a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) - i \, \sqrt {2} a d \sqrt {\frac {1}{a d^{2}}} e^{\left (i \, d x + i \, c\right )} \log \left (-4 \, {\left ({\left (a d e^{\left (2 i \, d x + 2 i \, c\right )} + a d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {\frac {1}{a d^{2}}} - a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) + \sqrt {2} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} {\left (-10 i \, e^{\left (2 i \, d x + 2 i \, c\right )} - 2 i\right )}\right )} e^{\left (-i \, d x - i \, c\right )}}{4 \, a d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+I*a*tan(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

1/4*(I*sqrt(2)*a*d*sqrt(1/(a*d^2))*e^(I*d*x + I*c)*log(4*((a*d*e^(2*I*d*x + 2*I*c) + a*d)*sqrt(a/(e^(2*I*d*x +
 2*I*c) + 1))*sqrt(1/(a*d^2)) + a*e^(I*d*x + I*c))*e^(-I*d*x - I*c)) - I*sqrt(2)*a*d*sqrt(1/(a*d^2))*e^(I*d*x
+ I*c)*log(-4*((a*d*e^(2*I*d*x + 2*I*c) + a*d)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*sqrt(1/(a*d^2)) - a*e^(I*d*x
+ I*c))*e^(-I*d*x - I*c)) + sqrt(2)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*(-10*I*e^(2*I*d*x + 2*I*c) - 2*I))*e^(-I
*d*x - I*c)/(a*d)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tan \left (d x + c\right )^{2}}{\sqrt {i \, a \tan \left (d x + c\right ) + a}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+I*a*tan(d*x+c))^(1/2),x, algorithm="giac")

[Out]

integrate(tan(d*x + c)^2/sqrt(I*a*tan(d*x + c) + a), x)

________________________________________________________________________________________

maple [A]  time = 0.18, size = 73, normalized size = 0.74 \[ -\frac {2 i \left (\sqrt {a +i a \tan \left (d x +c \right )}-\frac {\sqrt {a}\, \sqrt {2}\, \arctanh \left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{4}+\frac {a}{2 \sqrt {a +i a \tan \left (d x +c \right )}}\right )}{d a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^2/(a+I*a*tan(d*x+c))^(1/2),x)

[Out]

-2*I/d/a*((a+I*a*tan(d*x+c))^(1/2)-1/4*a^(1/2)*2^(1/2)*arctanh(1/2*(a+I*a*tan(d*x+c))^(1/2)*2^(1/2)/a^(1/2))+1
/2*a/(a+I*a*tan(d*x+c))^(1/2))

________________________________________________________________________________________

maxima [A]  time = 0.77, size = 101, normalized size = 1.03 \[ -\frac {i \, {\left (\sqrt {2} a^{\frac {5}{2}} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) + 8 \, \sqrt {i \, a \tan \left (d x + c\right ) + a} a^{2} + \frac {4 \, a^{3}}{\sqrt {i \, a \tan \left (d x + c\right ) + a}}\right )}}{4 \, a^{3} d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+I*a*tan(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

-1/4*I*(sqrt(2)*a^(5/2)*log(-(sqrt(2)*sqrt(a) - sqrt(I*a*tan(d*x + c) + a))/(sqrt(2)*sqrt(a) + sqrt(I*a*tan(d*
x + c) + a))) + 8*sqrt(I*a*tan(d*x + c) + a)*a^2 + 4*a^3/sqrt(I*a*tan(d*x + c) + a))/(a^3*d)

________________________________________________________________________________________

mupad [B]  time = 0.26, size = 83, normalized size = 0.85 \[ -\frac {1{}\mathrm {i}}{d\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}-\frac {\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,2{}\mathrm {i}}{a\,d}-\frac {\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-a}}\right )\,1{}\mathrm {i}}{2\,\sqrt {-a}\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)^2/(a + a*tan(c + d*x)*1i)^(1/2),x)

[Out]

- 1i/(d*(a + a*tan(c + d*x)*1i)^(1/2)) - ((a + a*tan(c + d*x)*1i)^(1/2)*2i)/(a*d) - (2^(1/2)*atan((2^(1/2)*(a
+ a*tan(c + d*x)*1i)^(1/2))/(2*(-a)^(1/2)))*1i)/(2*(-a)^(1/2)*d)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\tan ^{2}{\left (c + d x \right )}}{\sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**2/(a+I*a*tan(d*x+c))**(1/2),x)

[Out]

Integral(tan(c + d*x)**2/sqrt(I*a*(tan(c + d*x) - I)), x)

________________________________________________________________________________________